<?php 
	$cat = $_GET['cat'];
?>
<table>
<tr>
	<td><h2 class="pad_bot1">Categoria <?php echo $cat?>&#176;</h2></td>
</tr>
</table>
<?php
if(!file_exists('2012/rank'.$cat.'.txt'))
  {
  die("Ranking no disponible por el momento.");
  }else{
?>
<table width="600px" border="1px" cellspacing="0" align="center">
<tr bgcolor="#76a300" align="center" style="color:white; background-color:#76a300; border: solid 1px black;">
	<td width="50px"><b>Ranking</b></td>
	<td width="200px"><b>Nombre</b></td>
	<td width="50px"><b>Puntos</b></td>
</tr>
<?php 




    $vlineas = file('2012/rank'.$cat.'.txt'); 
    $c = 0; 
    foreach ($vlineas as $sLinea){
    	$array = preg_split('[-]', $sLinea);
    if ($c<8) $bgcolor = "#AEDB74";
    else $bgcolor = "#FFF";	
?>
<tr align="center" style="color:black; background-color:<?php echo $bgcolor;?>; border: solid 1px black;" >
	<td><?php echo $array[0] ?></td>
	<td><?php echo $array[1] ?></td>
	<td><?php echo $array[2] ?></td>
</tr>

<?php
	$c = $c +1;
    }
?>
</table>
<?php } ?>